package edu.auctionmart

import edu.auctionmart.jobs.AlertReminderJob

class QueueService {
	
	static List<AlertReminderJob> jobs = new ArrayList<AlertReminderJob>()
	
	def emailService
	
	def smsService
	
	def userService

    public static synchronized void addToQueueAndExecute(AlertReminderJob jobToAdd) {


		jobs.add(jobToAdd)
		
		for(AlertReminderJob job : jobs) {
			String result = job.runJob()
			println(result)
		}
		jobs.clear()

    }
}
